export interface SkuImageItem {
  id?: number;
  imgName: string;
  imgUrl: string;
  isDefault: "1" | "0";
}
export type SkuImageList = SkuImageItem[];

export interface SkuItem {
  skuName: string;
  price: number | undefined;
  weight: number | undefined;
  skuDesc: string;
  skuImageList: SkuImageList;
  skuDefaultImg: string;
}

export interface SkuAttrValueItem {
  attrId: number;
  attrName: string;
  valueId: number;
  valueName: string;
  id?: number;
  skuId?: number;
}

export type SkuAttrValueList = SkuAttrValueItem[];

export interface SkuSaleAttrValueItem {
  saleAttrId: number;
  saleAttrName: string;
  saleAttrValueId: number;
  saleAttrValueName: string;
  id?: number;
  skuId?: number;
  spuId?: number;
}

export type SkuSaleAttrValueList = SkuSaleAttrValueItem[];

// 发送和修改请求
export interface AddOrUpdateSkuParams extends SkuItem {
  id?: number;
  spuId: number;
  category3Id: number;
  skuAttrValueList: SkuAttrValueList;
  skuSaleAttrValueList: SkuSaleAttrValueList;
}

// 组件使用SkuFormData
export interface SkuFormData extends SkuItem {
  skuAttrValueList: Array<string | number>;
  skuSaleAttrValueList: Array<string | number>;
}

export type SkuList = AddOrUpdateSkuParams[];

export interface GetSkuListApiResponse {
  records: SkuList;
  total: number;
}
